package com.cdh.edu.controller.api;

import com.cdh.edu.entity.vo.SubjectVo;
import com.cdh.edu.service.SubjectService;
import com.cdh.utils.result.Restful;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author by cdh
 * @description:
 * @Date: Created in 11:59 on 2021/2/26
 */
@Api(tags = "课程分类")
@RestController
@RequestMapping("api/edu/subject")
@CrossOrigin
public class ApiSubjectController {

    @Autowired
    private SubjectService subjectService;

    @ApiOperation(value = "嵌套数据列表")
    @GetMapping("nested-list")
    public Restful nestedList(){
        List<SubjectVo> subjectVoList = subjectService.nestedList();
        return Restful.ok().data("subjectList",subjectVoList);
    }
}
